<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title>常用工程计算</title>
</head>
<body>
	
<form action="calculate">
	 r : 
	<input type="text" id="r" name="r">
	<br>
	 H :
	<input type="text" id="h" name="h">
	<br>
	 ф  :
	<input type="text" id="j" name="j">
	<br>
	 α  :
	<input type="text" id="a" name="a">
	<br>
	 δ  :
	<input type="text" id="b" name="b">
	<br>
	 β  :
	<input type="text" id="p" name="p">

	<br><br>
	<input type="button" value="计算" onclick="calculate()">
	<br><br>
	答案
	<br>
	<div id="answer"></div>
	<input type="text" name="ans" id="ans">
</form> 

<script type="text/javascript">
	
function calculate() {
	var r  = document.getElementById("r").value;
	var h  = document.getElementById("h").value;
	var j  = document.getElementById("j").value;
	var a  = document.getElementById("a").value;
	var b  = document.getElementById("b").value;
	var p  = document.getElementById("p").value;
	alert(r+ " "+ h+ " "+j+ " "+a+ " "+b + " "+p+ " ");
	var ans = 0;
	ans = 1.0 * r * h * h 
	* Math.cos(j - a)* Math.cos(j - a) 
	/ Math.cos(a)*Math.cos(a) * Math.cos(a+ b) 
	* (1 + Math.sqrt( Math.sin(j + b) *  Math.sin(j + p) / Math.cos(a + b) * Math.cos(a-p) )*Math.sqrt( Math.sin(j + b) *  Math.sin(j + p) / Math.cos(a + b) * Math.cos(a-p) ))
	* (1 + Math.sqrt( Math.sin(j + b) *  Math.sin(j + p) / Math.cos(a + b) * Math.cos(a-p) )*Math.sqrt( Math.sin(j + b) *  Math.sin(j + p) / Math.cos(a + b) * Math.cos(a-p) ));

	document.getElementById("ans").value = ans;
}
</script>
</body>
</html>